module top_module(
    input [31:0] a,
    input [31:0] b,
    input sub,
    output [31:0] sum
);

    wire [31:0] sub_b;
    wire cout;

    assign sub_b = b ^ {32{sub}};

    add16 inst1 (.a(a[15:0]), .b(sub_b[15:0]), .cin(sub), .sum(sum[15:0]), .cout(cout));
    add16 inst2 (.a(a[31:16]), .b(sub_b[31:16]), .cin(cout), .sum(sum[31:16]));

endmodule
